using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VGPACK
    {
        public DataRow Convert2GPACK(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryGPACK(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
                    dwReturn["GPAMANDANT"] = " ".PadRight(2);
                    dwReturn["GPALIEFSCH"] = " ".PadRight(8);
                    dwReturn["GPAPACKNR"] = " ".PadRight(4);
                    dwReturn["GPAPACKPOS"] = " ".PadRight(4);
                    dwReturn["GPAAUFKRS"] = " ".PadRight(2);
                    dwReturn["GPAAUFLFD"] = " ".PadRight(6);
                    dwReturn["GPAAUFPOS"] = " ".PadRight(3);
                    dwReturn["GPASA"] = " ".PadRight(3);
                    dwReturn["GPATEILNR"] = " ".PadRight(4);
                    dwReturn["GPAPOS"] = " ".PadRight(2);
                    dwReturn["GPAPARTIE"] = " ".PadRight(7);
                    dwReturn["GPAPARTIEKZ"] = " ".PadRight(1);
                    dwReturn["GPALO"] = " ".PadRight(2);
                    dwReturn["GPALB"] = " ".PadRight(2);
                    dwReturn["GPALBEHI"] = " ".PadRight(10);
                    dwReturn["GPASPPART"] = " ".PadRight(10);
                    dwReturn["GPAFBPART"] = " ".PadRight(10);
                    dwReturn["GPAZWPART"] = " ".PadRight(10);
                    dwReturn["GPALIEFZWP"] = " ".PadRight(10);
                    dwReturn["GPAART"] = " ".PadRight(20);
                    dwReturn["GPAVAR"] = " ".PadRight(3);
                    dwReturn["GPAFARBE"] = " ".PadRight(10);
                    dwReturn["GPAKG"] = " ".PadRight(0);
                    dwReturn["GPAKA"] = " ".PadRight(0);
                    dwReturn["GPASP"] = " ".PadRight(0);
                    dwReturn["GPAKGNET"] = " ".PadRight(0);
                    dwReturn["GPATARA"] = " ".PadRight(0);
                    dwReturn["GPAHUELGEW"] = " ".PadRight(0);
                    dwReturn["GPAHUELTYP"] = " ".PadRight(6);
                    dwReturn["GPAAUFMSL"] = " ".PadRight(2);
                    dwReturn["GPAPSTART"] = " ".PadRight(4);
                    dwReturn["GPALAENGE"] = " ".PadRight(0);
                    dwReturn["GPABEM"] = " ".PadRight(40);
                    dwReturn["GPAABZUGKZ1"] = " ".PadRight(1);
                    dwReturn["GPAABZUGKZ2"] = " ".PadRight(1);
                    dwReturn["GPAABZUGKZ3"] = " ".PadRight(1);
                    dwReturn["GPAABZUGKZ4"] = " ".PadRight(1);
                    dwReturn["GPAZUSTAND"] = " ".PadRight(4);
                    dwReturn["GPAOWNER"] = " ".PadRight(8);
                    dwReturn["GPAINVOICE"] = " ".PadRight(8);
                    dwReturn["GPAINVOICEPOS"] = " ".PadRight(3);
                    dwReturn["GPAPRODLO"] = " ".PadRight(2);
                    dwReturn["GPAPRODDAT"] = " ".PadRight(0);
                    dwReturn["GPAKOND"] = " ".PadRight(0);
                    dwReturn["GPATEXTSL"] = " ".PadRight(2);
                    dwReturn["GPACARRIER"] = " ".PadRight(8);
                    dwReturn["GPACARRPOS"] = " ".PadRight(3);
                    dwReturn["GPACARRNOPA"] = " ".PadRight(0);
                    dwReturn["GPAURLAND"] = " ".PadRight(3);
                    dwReturn["GPAVERZKZ"] = " ".PadRight(1);
                    dwReturn["GPALBEH"] = " ".PadRight(10);
                    dwReturn["GPAMNRKRS"] = " ".PadRight(2);
                    dwReturn["GPAMLFDNR"] = " ".PadRight(4);
                    dwReturn["GPAMPOS"] = " ".PadRight(2);
                    dwReturn["GPASCHICHT"] = " ".PadRight(1);
                    dwReturn["GPAKONDKZ"] = " ".PadRight(1);
                    dwReturn["GPAIKOND"] = " ".PadRight(0);
                    dwReturn["GPAIKONDUR"] = " ".PadRight(1);
                    dwReturn["GPAURLB"] = " ".PadRight(2);
                    dwReturn["GPAURLP"] = " ".PadRight(8);
                    dwReturn["GPAURAKZ"] = " ".PadRight(1);
                    dwReturn["GPAKGALT"] = " ".PadRight(0);
                    dwReturn["GPAHGEWABZ"] = " ".PadRight(1);
                    dwReturn["GPADRKG"] = " ".PadRight(0);
                    dwReturn["GPADRKGNET"] = " ".PadRight(0);
                    dwReturn["GPARAMPE"] = " ".PadRight(1);
                    dwReturn["GPAFILLER"] = " ".PadRight(21);
                    dwReturn["GPAAENZL"] = " ".PadRight(0);
                    dwReturn["GPAAENB"] = " ".PadRight(8);
                    dwReturn["GPAAEND"] = " ".PadRight(0);
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapGPACK(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveGPACK(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryGPACK(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapGPACK(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertGPACK(dwLocal, ITXDBVERSION);
            }
            UpdateGPACK(dwLocal);
        }
        public void InsertGPACK(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO GPACK(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }

            Connect2Proxy(or1);
        }
        public DataSet QueryGPACK(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    break;
                case 2:
                    or1.CommandText = "SELECT G.* FROM GPACK G JOIN VVLIEF V ON GPAMANDANT=VVMANDANT AND GPALIEFSCH=VVLIEFSCH JOIN VVTLIEF T ON V.VVMANDANT=VVTMANDANT AND VVLIEFSCH=VVTLIEFSCH"
               + " WHERE VVTMANDANT=:VVTMANDANT: AND VVTAUFKRS =:VVTAUFKRS: AND VVTAUFLFD=:VVTAUFLFD:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
                    break;
                case 3:
                    or1.CommandText = "SELECT VVLIEFSCH,P.* FROM GPACK P  JOIN VVLIEF ON VVLIEFSCH=GPALIEFSCH WHERE  VVNEUDAT>='" + dwData["DSTART"].ToString() + "' AND VVNEUDAT<='" + dwData["DEND"].ToString() + "' AND VVSTATUS IN (" + dwData["C20"].ToString() + ")";
                    break;
                case 4:
                    or1.CommandText = "SELECT G.* FROM GPACK G  WHERE GPAMANDANT=:GPAMANDANT: AND GPALIEFSCH =:GPALIEFSCH:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
                    break;
                case 5:
                    or1.CommandText = "SELECT VVLIEFSCH,G.* FROM GPACK G JOIN VVLIEF ON VVLIEFSCH=GPALIEFSCH AND VVMANDANT=GPAMANDANT"
                       + " WHERE  VVMANDANT=:VVMANDANT: AND VVLIEFSCH=:VVLIEFSCH:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "GPACK";
            Return = Result;
            return Return;
        }
        public void DeleteGPACK(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM GPACK   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }

        public void UpdateGPACK(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command====
                    or1.CommandText = "UPDATE GPACK SET "
                    + "GPAMANDANT= :GPAMANDANT,"
                    + "GPALIEFSCH= :GPALIEFSCH,"
                    + "GPAPACKNR= :GPAPACKNR,"
                    + "GPAPACKPOS= :GPAPACKPOS,"
                    + "GPAAUFKRS= :GPAAUFKRS,"
                    + "GPAAUFLFD= :GPAAUFLFD,"
                    + "GPAAUFPOS= :GPAAUFPOS,"
                    + "GPASA= :GPASA,"
                    + "GPATEILNR= :GPATEILNR,"
                    + "GPAPOS= :GPAPOS,"
                    + "GPAPARTIE= :GPAPARTIE,"
                    + "GPAPARTIEKZ= :GPAPARTIEKZ,"
                    + "GPALO= :GPALO,"
                    + "GPALB= :GPALB,"
                    + "GPALBEHI= :GPALBEHI,"
                    + "GPASPPART= :GPASPPART,"
                    + "GPAFBPART= :GPAFBPART,"
                    + "GPAZWPART= :GPAZWPART,"
                    + "GPALIEFZWP= :GPALIEFZWP,"
                    + "GPAART= :GPAART,"
                    + "GPAVAR= :GPAVAR,"
                    + "GPAFARBE= :GPAFARBE,"
                    + "GPAKG= :GPAKG,"
                    + "GPAKA= :GPAKA,"
                    + "GPASP= :GPASP,"
                    + "GPAKGNET= :GPAKGNET,"
                    + "GPATARA= :GPATARA,"
                    + "GPAHUELGEW= :GPAHUELGEW,"
                    + "GPAHUELTYP= :GPAHUELTYP,"
                    + "GPAAUFMSL= :GPAAUFMSL,"
                    + "GPAPSTART= :GPAPSTART,"
                    + "GPALAENGE= :GPALAENGE,"
                    + "GPABEM= :GPABEM,"
                    + "GPAABZUGKZ1= :GPAABZUGKZ1,"
                    + "GPAABZUGKZ2= :GPAABZUGKZ2,"
                    + "GPAABZUGKZ3= :GPAABZUGKZ3,"
                    + "GPAABZUGKZ4= :GPAABZUGKZ4,"
                    + "GPAZUSTAND= :GPAZUSTAND,"
                    + "GPAOWNER= :GPAOWNER,"
                    + "GPAINVOICE= :GPAINVOICE,"
                    + "GPAINVOICEPOS= :GPAINVOICEPOS,"
                    + "GPAPRODLO= :GPAPRODLO,"
                    + "GPAPRODDAT= :GPAPRODDAT,"
                    + "GPAKOND= :GPAKOND,"
                    + "GPATEXTSL= :GPATEXTSL,"
                    + "GPACARRIER= :GPACARRIER,"
                    + "GPACARRPOS= :GPACARRPOS,"
                    + "GPACARRNOPA= :GPACARRNOPA,"
                    + "GPAURLAND= :GPAURLAND,"
                    + "GPAVERZKZ= :GPAVERZKZ,"
                    + "GPALBEH= :GPALBEH,"
                    + "GPAMNRKRS= :GPAMNRKRS,"
                    + "GPAMLFDNR= :GPAMLFDNR,"
                    + "GPAMPOS= :GPAMPOS,"
                    + "GPASCHICHT= :GPASCHICHT,"
                    + "GPAKONDKZ= :GPAKONDKZ,"
                    + "GPAIKOND= :GPAIKOND,"
                    + "GPAIKONDUR= :GPAIKONDUR,"
                    + "GPAURLB= :GPAURLB,"
                    + "GPAURLP= :GPAURLP,"
                    + "GPAURAKZ= :GPAURAKZ,"
                    + "GPAKGALT= :GPAKGALT,"
                    + "GPAHGEWABZ= :GPAHGEWABZ,"
                    + "GPADRKG= :GPADRKG,"
                    + "GPADRKGNET= :GPADRKGNET,"
                    + "GPARAMPE= :GPARAMPE,"
                    + "GPAFILLER= :GPAFILLER,"
                    + "GPAAENZL= :GPAAENZL,"
                    + "GPAAENB= :GPAAENB,"
                    + "GPAAEND= :GPAAEND,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
                    or1.Parameters.Add("GPAMANDANT", OracleType.NVarChar).Value = dwData["GPAMANDANT"].ToString();
                    or1.Parameters.Add("GPALIEFSCH", OracleType.NVarChar).Value = dwData["GPALIEFSCH"].ToString();
                    or1.Parameters.Add("GPAPACKNR", OracleType.NVarChar).Value = dwData["GPAPACKNR"].ToString();
                    or1.Parameters.Add("GPAPACKPOS", OracleType.NVarChar).Value = dwData["GPAPACKPOS"].ToString();
                    or1.Parameters.Add("GPAAUFKRS", OracleType.NVarChar).Value = dwData["GPAAUFKRS"].ToString();
                    or1.Parameters.Add("GPAAUFLFD", OracleType.NVarChar).Value = dwData["GPAAUFLFD"].ToString();
                    or1.Parameters.Add("GPAAUFPOS", OracleType.NVarChar).Value = dwData["GPAAUFPOS"].ToString();
                    or1.Parameters.Add("GPASA", OracleType.NVarChar).Value = dwData["GPASA"].ToString();
                    or1.Parameters.Add("GPATEILNR", OracleType.NVarChar).Value = dwData["GPATEILNR"].ToString();
                    or1.Parameters.Add("GPAPOS", OracleType.NVarChar).Value = dwData["GPAPOS"].ToString();
                    or1.Parameters.Add("GPAPARTIE", OracleType.NVarChar).Value = dwData["GPAPARTIE"].ToString();
                    or1.Parameters.Add("GPAPARTIEKZ", OracleType.NVarChar).Value = dwData["GPAPARTIEKZ"].ToString();
                    or1.Parameters.Add("GPALO", OracleType.NVarChar).Value = dwData["GPALO"].ToString();
                    or1.Parameters.Add("GPALB", OracleType.NVarChar).Value = dwData["GPALB"].ToString();
                    or1.Parameters.Add("GPALBEHI", OracleType.NVarChar).Value = dwData["GPALBEHI"].ToString();
                    or1.Parameters.Add("GPASPPART", OracleType.NVarChar).Value = dwData["GPASPPART"].ToString();
                    or1.Parameters.Add("GPAFBPART", OracleType.NVarChar).Value = dwData["GPAFBPART"].ToString();
                    or1.Parameters.Add("GPAZWPART", OracleType.NVarChar).Value = dwData["GPAZWPART"].ToString();
                    or1.Parameters.Add("GPALIEFZWP", OracleType.NVarChar).Value = dwData["GPALIEFZWP"].ToString();
                    or1.Parameters.Add("GPAART", OracleType.NVarChar).Value = dwData["GPAART"].ToString();
                    or1.Parameters.Add("GPAVAR", OracleType.NVarChar).Value = dwData["GPAVAR"].ToString();
                    or1.Parameters.Add("GPAFARBE", OracleType.NVarChar).Value = dwData["GPAFARBE"].ToString();
                    or1.Parameters.Add("GPAKG", OracleType.NVarChar).Value = dwData["GPAKG"].ToString();
                    or1.Parameters.Add("GPAKA", OracleType.NVarChar).Value = dwData["GPAKA"].ToString();
                    or1.Parameters.Add("GPASP", OracleType.NVarChar).Value = dwData["GPASP"].ToString();
                    or1.Parameters.Add("GPAKGNET", OracleType.NVarChar).Value = dwData["GPAKGNET"].ToString();
                    or1.Parameters.Add("GPATARA", OracleType.NVarChar).Value = dwData["GPATARA"].ToString();
                    or1.Parameters.Add("GPAHUELGEW", OracleType.NVarChar).Value = dwData["GPAHUELGEW"].ToString();
                    or1.Parameters.Add("GPAHUELTYP", OracleType.NVarChar).Value = dwData["GPAHUELTYP"].ToString();
                    or1.Parameters.Add("GPAAUFMSL", OracleType.NVarChar).Value = dwData["GPAAUFMSL"].ToString();
                    or1.Parameters.Add("GPAPSTART", OracleType.NVarChar).Value = dwData["GPAPSTART"].ToString();
                    or1.Parameters.Add("GPALAENGE", OracleType.NVarChar).Value = dwData["GPALAENGE"].ToString();
                    or1.Parameters.Add("GPABEM", OracleType.NVarChar).Value = dwData["GPABEM"].ToString();
                    or1.Parameters.Add("GPAABZUGKZ1", OracleType.NVarChar).Value = dwData["GPAABZUGKZ1"].ToString();
                    or1.Parameters.Add("GPAABZUGKZ2", OracleType.NVarChar).Value = dwData["GPAABZUGKZ2"].ToString();
                    or1.Parameters.Add("GPAABZUGKZ3", OracleType.NVarChar).Value = dwData["GPAABZUGKZ3"].ToString();
                    or1.Parameters.Add("GPAABZUGKZ4", OracleType.NVarChar).Value = dwData["GPAABZUGKZ4"].ToString();
                    or1.Parameters.Add("GPAZUSTAND", OracleType.NVarChar).Value = dwData["GPAZUSTAND"].ToString();
                    or1.Parameters.Add("GPAOWNER", OracleType.NVarChar).Value = dwData["GPAOWNER"].ToString();
                    or1.Parameters.Add("GPAINVOICE", OracleType.NVarChar).Value = dwData["GPAINVOICE"].ToString();
                    or1.Parameters.Add("GPAINVOICEPOS", OracleType.NVarChar).Value = dwData["GPAINVOICEPOS"].ToString();
                    or1.Parameters.Add("GPAPRODLO", OracleType.NVarChar).Value = dwData["GPAPRODLO"].ToString();
                    or1.Parameters.Add("GPAPRODDAT", OracleType.NVarChar).Value = dwData["GPAPRODDAT"].ToString();
                    or1.Parameters.Add("GPAKOND", OracleType.NVarChar).Value = dwData["GPAKOND"].ToString();
                    or1.Parameters.Add("GPATEXTSL", OracleType.NVarChar).Value = dwData["GPATEXTSL"].ToString();
                    or1.Parameters.Add("GPACARRIER", OracleType.NVarChar).Value = dwData["GPACARRIER"].ToString();
                    or1.Parameters.Add("GPACARRPOS", OracleType.NVarChar).Value = dwData["GPACARRPOS"].ToString();
                    or1.Parameters.Add("GPACARRNOPA", OracleType.NVarChar).Value = dwData["GPACARRNOPA"].ToString();
                    or1.Parameters.Add("GPAURLAND", OracleType.NVarChar).Value = dwData["GPAURLAND"].ToString();
                    or1.Parameters.Add("GPAVERZKZ", OracleType.NVarChar).Value = dwData["GPAVERZKZ"].ToString();
                    or1.Parameters.Add("GPALBEH", OracleType.NVarChar).Value = dwData["GPALBEH"].ToString();
                    or1.Parameters.Add("GPAMNRKRS", OracleType.NVarChar).Value = dwData["GPAMNRKRS"].ToString();
                    or1.Parameters.Add("GPAMLFDNR", OracleType.NVarChar).Value = dwData["GPAMLFDNR"].ToString();
                    or1.Parameters.Add("GPAMPOS", OracleType.NVarChar).Value = dwData["GPAMPOS"].ToString();
                    or1.Parameters.Add("GPASCHICHT", OracleType.NVarChar).Value = dwData["GPASCHICHT"].ToString();
                    or1.Parameters.Add("GPAKONDKZ", OracleType.NVarChar).Value = dwData["GPAKONDKZ"].ToString();
                    or1.Parameters.Add("GPAIKOND", OracleType.NVarChar).Value = dwData["GPAIKOND"].ToString();
                    or1.Parameters.Add("GPAIKONDUR", OracleType.NVarChar).Value = dwData["GPAIKONDUR"].ToString();
                    or1.Parameters.Add("GPAURLB", OracleType.NVarChar).Value = dwData["GPAURLB"].ToString();
                    or1.Parameters.Add("GPAURLP", OracleType.NVarChar).Value = dwData["GPAURLP"].ToString();
                    or1.Parameters.Add("GPAURAKZ", OracleType.NVarChar).Value = dwData["GPAURAKZ"].ToString();
                    or1.Parameters.Add("GPAKGALT", OracleType.NVarChar).Value = dwData["GPAKGALT"].ToString();
                    or1.Parameters.Add("GPAHGEWABZ", OracleType.NVarChar).Value = dwData["GPAHGEWABZ"].ToString();
                    or1.Parameters.Add("GPADRKG", OracleType.NVarChar).Value = dwData["GPADRKG"].ToString();
                    or1.Parameters.Add("GPADRKGNET", OracleType.NVarChar).Value = dwData["GPADRKGNET"].ToString();
                    or1.Parameters.Add("GPARAMPE", OracleType.NVarChar).Value = dwData["GPARAMPE"].ToString();
                    or1.Parameters.Add("GPAFILLER", OracleType.NVarChar).Value = dwData["GPAFILLER"].ToString();
                    or1.Parameters.Add("GPAAENZL", OracleType.NVarChar).Value = dwData["GPAAENZL"].ToString();
                    or1.Parameters.Add("GPAAENB", OracleType.NVarChar).Value = dwData["GPAAENB"].ToString();
                    or1.Parameters.Add("GPAAEND", OracleType.NVarChar).Value = dwData["GPAAEND"].ToString();
                    #endregion
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
    }
}
